;~ close_application

#NoTrayIcon

If $CmdLine[0] <> 1 Then
 	Exit(-1)
EndIf

$list = ProcessList($CmdLine[1])

If $list[0][0] > 0 Then
	$pid = $list[1][1]
	
	$var = WinList()

	For $i = 1 to $var[0][0]
		If WinGetProcess($var[1][0]) = $pid Then
			WinClose($var[1][0])
		EndIf
	Next

	
EndIf
